<template>
	<view :class="['activeDetail',device == 'ios'?'iosPadding':'androidPadding']">
		<view :class="device=='ios'?'ios_pageTitle':'and_pageTitle'">
			<view class="statusBar"></view>
			<view :class="['pageTitle','dFlex','jBetween_aCenter']">
				<view class="titLeft dFlex jStart_aCenter">
					<view class="backIcon imgPublic" @tap.stop='backHome'>
						<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/back3.png" mode="widthFix"></image>
					</view>
					<view class="title">{{datas.title}}</view>
					<view class="backIcon imgPublic" style="visibility: hidden;">
						<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/back2.png" mode="widthFix"></image>
					</view>
				</view>
			</view>
		</view>
		<view class="content">
			<view class="regiment">
				<view class="timeShow dFlex jBetween_aCenter" v-if="datas.is_limit !='0'">
					<view class="endTime dFlex jCenter_aCenter">
						<!-- <view class="timeIcon imgPublic">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/time.png" mode="widthFix"></image>
						</view> -->
						<text v-if="datas.activity_status == '1'">距离团购结束：</text>
						<text v-if="datas.activity_status == '2'">距离团购开始：</text>
						<view class="timeDown" v-if="datas.activity_status == '1'"><u-count-down :timestamp="calcTime(datas.end_time)" bg-color='#ffffff' color='#FB5D02' separator-color='#ffffff' height='48' :separator-size='28' :font-size='28'></u-count-down></view>
						<view class="timeDown" v-if="datas.activity_status == '2'"><u-count-down :timestamp="calcTime(datas.start_time)" bg-color='#ffffff' color='#FB5D02' separator-color='#ffffff' height='48' :separator-size='28' :font-size='28'></u-count-down></view>
					</view>
					<view class="time imgPublic">
						<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/active_time.png" mode="widthFix"></image>
					</view>
				</view>
				<view class="teamInfo" v-if='leaderInfo.address_id'> 
					<view class="userInfo dFlex jBetween_aCenter" >
						<view class="tuanzhang dFlex jStart_aCenter">
							<view class="userTx imgPublic">
								<image v-if="leaderInfo.store_imgs" :src="leaderInfo.store_imgs"></image>
								<image v-else src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/assets/img/store.jpg"></image>
							</view>
							<text>{{leaderInfo.store_name?leaderInfo.store_name:leaderInfo.receiver}}</text>
							<view class="tag">提货点</view>
						</view>
					</view>
					<view class="base dFlex jBetween_aCenter">
						<view class="baseLeft dFlex jStart_aStart">
							<view class="titles dFlex jStart_aStart">
								<view class="addIcon imgPublic">
									<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/add1.png" mode="widthFix"></image>
								</view>
								<text>提货地址:</text>
							</view>
							<view class="info_content">{{leaderInfo.address_detail?leaderInfo.address_detail:leaderInfo.address}}</view>
						</view>
						<view class="exchange dFlex jEnd_aCenter" @tap='selZiti' v-if="isLogin">
							<view>切换</view>
							<view class="rightIcon imgPublic">
								<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/right.png" mode="widthFix"></image>
							</view>
						</view>
					</view>
					<!-- <view class="base dFlex jStart_aStart">
						<view class="titles dFlex jStart_aStart">
							<view class="addIcon imgPublic">
								<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/call.png" mode="widthFix"></image>
							</view>
							<text>联系电话:</text>
						</view>
						<view class="info_content">{{leaderInfo.mobile?leaderInfo.mobile:leaderInfo.phone}}</view>
					</view> -->
					<!-- <view class="base dFlex jStart_aStart">
						<view class="titles dFlex jStart_aStart">
							<view class="addIcon imgPublic">
								<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/timeIcon.png" mode="widthFix"></image>
							</view>
							<text>提货时间:</text>
						</view>
						<view class="info_content timeDetail">{{datas.get_time?datas.get_time:'次日达'}}</view>
					</view> -->
				</view>
			</view>
			<view class="product">
				<view class="shop dFlex jStart_aStart" v-for='(item,index) in datas.goods_list' :key='index'>
					<view class="shopImg imgPublic" @tap='lookDetail(item.goods_id)'>
						<image :src="item.goods_main_img" mode="widthFix"></image>
						<view class='yjCount dFlex jAround_aCenter' v-if='user.auth_status == "2"'>
							<view class='showYJ'>佣</view>
							<text>{{(parseFloat(item.goods_pt_price) * parseFloat(item.service_rate) / 100).toFixed(2)}}</text>
						</view>
					</view>
					<view class="shopInfo">
						<view class="shopName" @tap='lookDetail(item.goods_id)'>{{item.goods_title}}</view>
						<view class="jianshu dFlex jStart_aCenter" @tap='lookDetail(item.goods_id)'>
							<view class="sale" v-if='item.goods_set_stock - item.goods_stock > 0'>已抢{{item.goods_set_stock - item.goods_stock}}件</view>
							<view class="sheng">剩{{item.goods_stock}}件</view>
						</view>
						<view class="team dFlex jStart_aCenter" v-if="item.orderlist.length" @tap='lookDetail(item.goods_id)'>
							<view class="userTx dFlex jStart_aCenter">
								<view class="smallTx imgPublic" v-for="(item2,index2) in item.orderArr" :key='index2'>
									<image :src="item2.user_avatar"></image>
								</view>
							</view>
							<text>...等{{item.orderlist.length}}人已团</text>
						</view>
						<view class="config">
							<view class="priceTag dFlex jStart_aCenter">
								<view class="miaosha">团购价</view>
								<view class="jiang">已降{{(item.goods_old_price - item.goods_price).toFixed(2)}}元</view>
							</view>
							<view class="tools dFlex jBetween_aEnd">
								<view class="showPrice">￥<text>{{item.goods_pt_price?item.goods_pt_price:item.goods_price}}</text></view>
								<view class="count">
									<u-number-box v-model="item.count" :min='0' :disabled='item.goods_stock>0?false:true' @change='changeCount($event,index)'></u-number-box>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="team_member" v-if='datas.orderlist.length'>
				<view class="tit">———— 他们都在买 ————</view>
				<view class="memberList">
					<view class="part dFlex jStart_aCenter" v-for="(item,index) in datas.orderlist" :key='index'>
						<view class="idx">{{item.sort}}F</view>
						<view class="partInfo dFlex jStart_aCenter">
							<view class="userTx imgPublic">
								<image :src="item.user_avatar"></image>
							</view>
							<view class="info">
								<view class="base dFlex jStart_aCenter">
									<text class="nickName">{{item.user_nickname}}</text>
									<view class="time">{{item.createtime}}</view>
								</view>
								<view class="shopDesc">{{item.goods_name}}</view>
							</view>
						</view>
					</view>
				</view>
				<!-- <view class="shareBtn dFlex jStart_aCenter">
					<view class="shareIcon imgPublic">
						<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/share.png" mode="widthFix"></image>
					</view>
					<text>分享</text>
				</view> -->
			</view>
			<view class="seat"></view>
			<view :class="['bottomBtn',device == 'ios'?'ios_safe':'','dFlex','jBetween_aCenter']" v-if='!status'>
				<view class="opBtns dFlex jStart_aCenter">
					<view class="smallMenu" @tap.stop='backHome'>
						<view class="menuIcon">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/seckill_home.png" mode="widthFix"></image>
						</view>
						<text>首页</text>
					</view>
					<button open-type="share" class="smallMenu">
						<view class="menuIcon">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/seckill_share.png" mode="widthFix"></image>
						</view>
						<text>分享</text>
					</button>
					<view class="smallMenu">
						<view class="menuIcon">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/seckill_car.png" mode="widthFix"></image>
						</view>
						<text>购物车</text>
						<view class="count" v-if="count0>0">{{count0}}</view>
					</view>
				</view>
				<view class="tj dFlex jEnd_aCenter">
					<view class="allCount">
						<view class="resultPrice">合计:<text>￥{{price?price.toFixed(2):'0.00'}}</text></view>
						<view class="line2" v-if="coupon.length" @tap.stop='changeCouponFlag'>共优惠<text>￥{{cpCount}}</text></view>
					</view>
					<view class="payBtn" v-if="datas.activity_status == '1' && isLogin" @tap='subOrder'>去结算</view>
					<button class="payBtn" v-if="!isLogin" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">一键登录</button>
				</view>
			</view>
			<view class="zz dFlex flexDirection jCenter_aCenter zz2" v-if='postFlag'>
				<canvas canvas-id="myCanvas" id="myCanvas" :style="'width:80%;height:'+canvasHeight+'px;'"></canvas>
				<view class="seat"></view>
				<view :class="['opBtns',device == 'ios'?'ios_sureBtn':'']">
					<view class='toast'>立即分享</view>
					<view class='btns dFlex jAround_aCenter'>
						<button open-type="share" class="opBtnOne">
							<view class="btnImg imgPublic">
								<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/weixin.png" mode="widthFix"></image>
							</view>
							<text>微信好友</text>
						</button>
						<view class="opBtnOne" @tap.stop='saveImg'>
							<view class="btnImg imgPublic">
								<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/shareIcon4.png" mode="widthFix"></image>
							</view>
							<text>保存图片</text>
						</view>
					</view>
					<view class='close' @tap.stop='postFlag = false'>关闭</view>
				</view>
			</view>
			<!-- 优惠券选择弹窗 -->
			<view class="zz dFlex flexDirection jEnd_aCenter" v-if="couponFlag">
				<view class='coupon'>
					<view class="titles dFlex jCenter_aCenter">
						<view class="line"></view>
						<view class="tit">优惠券</view>
						<view class="line"></view>
					</view>
					<view class="tools dFlex jBetween_aCenter">
						<view class="count">可用优惠券({{coupon.length}})</view>
						<!-- <view class="explain">优惠券说明</view> -->
					</view>
					<view class="qList">
						<view class="cpOne" v-for="(item,index) in coupon" :key='index' @tap.stop='change_sekStatus(item)'>
							<view class="cpMain">
								<view class="cpBgImg imgPublic">
									<image v-if="!item.canUse" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/haveUse.png" mode="widthFix"></image>
									<image v-if="item.canUse" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/noUse.png" mode="widthFix"></image>
									<view class="statusIcon imgPublic" v-if="item.canUse">
										<image v-if="!item.selFlag" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/unsel.png" mode="widthFix"></image>
										<image v-if="item.selFlag" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/sel2.png" mode="widthFix"></image>
									</view>
								</view>
								<view class="cpContent dFlex jBetween_aCenter">
									<view class="contentLeft">
										<view class="tag" v-if="item.type == '0'">无门槛券</view>
										<view class="tag" v-if="item.type == '1'">满减券</view>
										<view class="tag" v-if="item.type == '2'">活动券</view>
										<view class="tag" v-if="item.type == '3'">立减券</view>
										<view class="tag" v-if="item.type == '4'">折扣券</view>
										<view class="content dFlex jStart_aStart">
											<!-- <view class="shopImg imgPublic">
												<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/logo.png" mode="widthFix"></image>
											</view> -->
											<view class="cpDetail">
												<view class="toast" v-if="item.type == 3">仅限指定商品使用</view>
												<view class="cpName">{{item.title}}</view>
												<view class="time">{{item.start_time_text.substring(0,item.start_time_text.length-3)}}至{{item.end_time_text.substring(0,item.start_time_text.length-3)}}</view>
												<view class="expbtn dFlex jStart_aCenter" @tap.stop='changeRuleFlag(item)'>
													<text>详细信息</text>
													<view class="exBtn imgPublic">
														<image v-if="item.ruleFlag" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/open.png" mode="widthFix"></image>
														<image v-if="!item.ruleFlag" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/close.png" mode="widthFix"></image>
													</view>
												</view>
											</view>
										</view>
									</view>
									<view class="contentRight dFlex flexDirection jCenter_aCenter">
										<view class="cpCount" v-if="item.type != '4'">￥<text>{{item.sub_price}}</text></view>
										<view class="cpCount" v-if="item.type == '4'"><text>{{item.discount}}</text>折</view>
										<view class="condition" v-if="item.type != '3' && item.type != '0' && item.type != '4'">满{{item.min_price}}元可用</view>
										<!-- <view class="useBtn">立即使用</view> -->
									</view>
								</view>
							</view> 
							<view class="explain" v-if="item.ruleFlag">
								<view class="line">{{item.rule}}</view>
							</view>
						</view>
					</view>
					<view class="btns dFlex jCenter_aCenter" @tap.stop='couponFlag = false'>
						<view class="btn">可减{{cpCount}}元，去结算</view>
					</view>
				</view>
			</view>
			<!-- <view class="zz dFlex jCenter_aCenter flexDirection" v-if="adv">
				<view class="advImg imgPublic" style="width: 80%;">
					<image :src="adv" mode="widthFix" :show-menu-by-longpress='true'></image>
				</view>
				<view class="closeBtn" @tap.stop='adv = ""'>	
					关闭
				</view>
				<view class="seat"></view>
				<view :class="['opBtns',device == 'ios'?'ios_sureBtn':'']">
					<view class='btns dFlex jAround_aCenter'>
						<button open-type="share" class="opBtnOne">
							<view class="btnImg imgPublic">
								<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/weixin.png" mode="widthFix"></image>
							</view>
							<text>微信好友</text>
						</button>
						<view class="opBtnOne" @tap.stop='saveImg'>
							<view class="btnImg imgPublic">
								<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/shareIcon4.png" mode="widthFix"></image>
							</view>
							<text>保存图片</text>
						</view>
					</view>
					<view class='close'>关闭</view>
				</view>
			</view> -->
		</view>
		<view class="service imgPublic" @click.stop='copyActive'>
			<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/copyBtn.png" mode="widthFix"></image>
		</view>
		<Address :store='storeOne' :count='count' @opFlag='closeAdd' @selLine='selLine' @changeAdd='selZiti'></Address>
		
		<login :loginStatus='loginStatus' @opFlag='closeLogin' :code='code' :status='1'></login>
	</view>
</template>

<script>
	import address from '@/components/address.vue';
	import login from '../components/login.vue';
	export default {
		components: {
			address,
			login
		},
		data() {
			return {
				user:{auth_status:'-1'},
				ptid:'',
				mobile:'',
				datas:{
					orderlist:[],
				},
				leaderInfo:{},
				count0:0,
				price:"",
				isLogin:getApp().globalData.isLogin,
				code:"",
				device:getApp().globalData.platform,
				status:0,
				
				canvasHeight:"",
				postFlag:false,
				shareCode:'',
				adv:'',
				postImg:'',//海报base64
				pageIdx:'',
				link:'',
				// 最近的门店
				storeOne:{},
				count:0,//弹窗提示限制1次
				
				// 优惠券
				coupon:[],
				couponFlag:false,
				cpCount:0.00,
				selcp:[],
				
				num:0,
				
				wallet:'',
				
				loginStatus:true,
				code:'',
				// 显示复制团购按钮
				copyBtn:false,
			};
		},
		onLoad(e) {
			console.log(e);
			if(e.scene){
				// 识别 扫描二维码
				let canshu = decodeURIComponent(e.scene)?decodeURIComponent(e.scene):'';
				this.link = canshu;
				let csArr = canshu.split('&');
				this.ptid = csArr[0].split('=')[1];
				this.mobile = csArr[1].split('=')[1];
				uni.setStorageSync('tjr_mobile',this.mobile);
			}else if(e.status){
				this.link = this.tool.objToUrl(e);
				// 推品、h5、团长活动页 跳c端
				this.ptid = e.ptid;
				this.mobile = e.mobile;
				this.status = 1;
				uni.setStorageSync('tjr_mobile',this.mobile);
			}else if(!e.status){
				// this.link = this.tool.objToUrl(e);
				//小程序卡片或者朋友圈进入
				this.pageIdx = e.pageIdx;
				this.ptid = e.ptid;
				if(e.shareId){
					uni.setStorageSync('shareInfo',{
						id:e.ptid,
						shareId:e.shareId,
						time:new Date().getTime(),
					});
				}
				if(e.mobile){
					this.mobile = e.mobile;
					uni.setStorageSync('tjr_mobile',this.mobile);
				}else{
					this.mobile = uni.getStorageSync('tjr_mobile');
				}
			}
			uni.getLocation({
				type:'wgs84',
				success: (locate) => {
					if(locate.errMsg == 'getLocation:ok'){
						getApp().globalData.lat = locate.latitude;
						getApp().globalData.lng = locate.longitude;
						if(this.ptid){
							this.initData();
							if(uni.getStorageSync('uToken')){
								this.initCoupon();
							}
						}
					} 
				},
				fail:(err)=>{
					getApp().globalData.city = '北京市';
					this.area = '北京市';
					uni.showToast({
						title:'位置信息获取失败',
						icon:"none"
					})
				},
			})
		},
		onShareAppMessage() {
			let share = {};
			if(!this.status){
				share.title = this.datas.title;
				share.path = '/my/activeDetail?ptid='+this.ptid+"&mobile="+this.mobile+"&shareId="+(uni.getStorageSync('uId')?uni.getStorageSync('uId'):"");
				share.imageUrl = this.datas.pt_img.startsWith("https://")?this.datas.pt_img:'https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/'+this.datas.pt_img;
				share.desc = this.datas.notice;
			}else{
				share.title = this.datas.share_words?this.datas.share_words:this.datas.title;
				share.path = '/my/activeDetail?ptid='+this.ptid+"&mobile="+this.mobile+"&shareId="+(uni.getStorageSync('uId')?uni.getStorageSync('uId'):"");
				share.imageUrl = this.datas.pt_img.startsWith("https://")?this.datas.pt_img:'https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/'+this.datas.pt_img;
				share.desc = this.datas.notice;
			}
			return share;
		},
		onShareTimeline() {
			let share = {};
			if(!this.status){
				share.title = this.datas.title;
				share.path = '/my/activeDetail?ptid='+this.ptid+"&mobile="+this.mobile+"&shareId="+(uni.getStorageSync('uId')?uni.getStorageSync('uId'):"");
				share.imageUrl = 'https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/'+this.datas.cover_img;
				share.desc = this.datas.notice;
			}else{
				share.title = this.datas.share_words?this.datas.share_words:this.datas.title;
				share.path = '/my/activeDetail?ptid='+this.ptid+"&mobile="+this.mobile+"&shareId="+(uni.getStorageSync('uId')?uni.getStorageSync('uId'):"");
				share.imageUrl = 'https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/'+this.datas.cover_img;
				share.desc = this.datas.notice;
			}
			return share;
		},
		onShow(e){
			// this.isLogin = getApp().globalData.isLogin?getApp().globalData.isLogin:false;
			this.isLogin = uni.getStorageSync('uToken')?uni.getStorageSync('uToken'):false;
			if(!this.isLogin){
				this.loginStatus = false;
				wx.login({
					success:(login)=>{
						this.code = login.code;
					},
					fail:(err)=>{
						console.log(err);
					}
				})
			}else{
				this.initUser();
				this.initwallet();
			}
		},
		methods:{
			// 复制活动
			copyActive(){
				uni.navigateTo({
					url:"./createGroupBuy?cpId="+this.ptid,
				})
			},
			initUser(){
				this.tool.getData('/api/user/info',{},'',this).then(res=>{
					if(res){
						this.user = res;
						this.copyBtn = res.auth_status == '2' ? true : false; 
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 关闭登录
			closeLogin(data){
				this.loginStatus = data;
				if(uni.getStorageSync('uToken')){
					this.initData();
					this.initCoupon(); 
					this.isLogin = true;
				}else{
					this.count = 1;
				}
			},
			initData(){
				console.log('参数');
				console.log('pt_id',this.ptid);
				console.log('tjr_mobile',this.mobile);
				console.log('lat',getApp().globalData.lat);
				console.log('lng',getApp().globalData.lng);
				this.tool.getData('/api/pintuan/getPintuanInfoToc',{
					pt_id:this.ptid?this.ptid:'',
					tjr_mobile:this.mobile?this.mobile:"",
					lat:getApp().globalData.lat,
					lng:getApp().globalData.lng,
				},"",this).then(res=>{
					console.log('活动信息');
					console.log(res);
					console.log('-----------');
					if(res){
						let PT = uni.getStorageSync('PT')?JSON.parse(uni.getStorageSync('PT')):{};
						res.goods_list.map((item,index)=>{
							let idx = '';
							if(PT.id && PT.id == this.ptid){
								idx = this.tool.getIdx(PT.goods_list,'goods_id',item.goods_id);
								if(idx != '-1'){
									item.count = PT.goods_list[idx].num;
									this.num = this.num + PT.goods_list[idx].num;
								}else{
									item.count = 0;
								}
							}else{
								item.count = 0;
							}
							item.orderArr = item.orderlist.slice(0,3);
						})
						res.orderlist.map((item,index)=>{
							if((/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(item.user_nickname))){
								item.user_nickname = item.user_nickname.substring(0, 3)+"****"+item.user_nickname.substr(item.user_nickname.length-4);
							}
							item.createtime = this.tool.timestampToTime(item.createtime * 1000,1);
							item.sort = res.orderlist.length - index;
						})
						if(res.start_time * 1000 > new Date().getTime()){//未开始
							res.activity_status = '2';
						}else if(res.start_time * 1000 <= new Date().getTime() && res.end_time * 1000){//进行中
							res.activity_status = '1';
						}else{//已结束
							res.activity_status = '3';
						}
						this.datas = res;
						if(uni.getStorageSync('user_level') == '2'){//团长
							// 判断团长有没有设置地址
							this.getLeaderAdd();
						}else{//普通用户
							if(res.leaderInfo.address_id == '0'){
								this.initAddList();
							}else{
								this.storeOne = res.leaderInfo;
							}
							this.leaderInfo = res.leaderInfo;
						}
						this.calcOrderNum();
						if(this.status){
							this.postFlag = true;
							// 分享二维码
							this.initCode();
						}
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 钱包余额
			initwallet(){
				this.tool.getData('/api/user/info',{},'',this).then(res=>{
					if(res){
						this.wallet = res.vip_rechage_balance;
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 优惠券列表
			initCoupon(){
				this.tool.getData('/api/mall/getUseCoupon',{
					source:'1',
					source_id:this.ptid,
				}).then(res=>{
					if(res && res.length){
						res.map((item,index)=>{
							item.selFlag = false;
							item.ruleFlag = false;
							item.canUse = false;
						})
						this.coupon = res;
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 修改优惠券开关
			changeCouponFlag(){
				this.couponFlag = !this.couponFlag;
				if(this.couponFlag && this.count > 0){
					this.coupon.map((item,index)=>{
						if(item.min_price > this.price){
							item.canUse = false;
						}else{
							item.canUse = true;
						}
					})
				}
			},
			// 修改优惠券使用状态
			change_sekStatus(line){
				if(line.canUse){
					this.coupon.map((item,index)=>{
						if(item.id != line.id){
							item.selFlag = false;
						}
					})
					line.selFlag = !line.selFlag;
					this.calcCoupon_Price();
				}
			},
			// 计算选中的优惠券的金额
			calcCoupon_Price(){
				this.cpCount = 0;
				this.selcp = [];//选中的优惠券
				this.coupon.map((item,index)=>{
					if(item.selFlag){
						this.selcp.push(item);
					}
				})
				if(this.selcp.length){
					this.selcp.map((item,index)=>{
						this.cpCount = parseFloat(this.cpCount) + parseFloat(item.sub_price);
					})
				}else{
					this.cpCount = 0;
				}
			},
			// 修改使用规则开关
			changeRuleFlag(line){
				line.ruleFlag = !line.ruleFlag;
			},
			getLeaderAdd(){
				this.tool.getData('/api/user/info',{},'',this).then(res=>{
					if(res){
						if(res.address_id){//设置了地址
							this.leaderInfo = {
								address:res.address,
								address_id:res.address_id,
								mobile:res.mobile?res.mobile:'',
								phone:res.phone?res.phone:'',
								nickname:res.nickname,
								address_detail:res.address_detail,
								id:res.id,
								store_imgs:res.store_imgs,
								store_name:res.store_name,
							}
						}else{//没设置地址 获取列表第一个
							this.initAddList();
						}
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			initAddList(){
				uni.getLocation({
					type:'wgs84',
					success: (locate) => {
						this.tool.getData('/api/mall/returnTeamList',{
							lat:locate.latitude,
							lng:locate.longitude,
							keyword:"",
						}).then(res=>{
							if(res && res.length){
								if(uni.getStorageSync('user_level') != '2'){
									this.storeOne = this.count == '0'?res[0]:{};
								}
								this.leaderInfo = res[0];
								this.leaderInfo.address_id = res[0].id;
								this.leaderInfo.nickname = res[0].receiver;
								this.leaderInfo.id = res[0].user_id;
							}
						}).catch(err=>{
							console.log(err);
						})
					},
					fail:(err)=>{
						console.log(err);
					},
					complete:()=>{
						if(this.status){
							this.initList();
						}
					}
				})
			},
			// 选择该地址
			selLine(data){
				this.leaderInfo = this.storeOne;
				this.count = 1;
			},
			// 关闭弹窗
			closeAdd(data){
				this.initAddList();
				this.count = data;
			},
			// 查看商品详情
			lookDetail(id){
				uni.navigateTo({
					url:'../seller/shopDetail?actType=1&actId='+this.ptid+'&id='+id
				})
			},
			// 提交订单
			subOrder(){
				let goods_list = [];
				this.datas.goods_list.map((item,index)=>{
					if(item.count>0){
						goods_list.push(item);
						/* goods_list.push({
							goods_id:item.goods_id,
							num:item.count
						}) */
					}
				})
				if(!goods_list.length){
					uni.showToast({
						title:'请至少添加一件商品', 
						icon:"none"
					})
					return;
				}
				uni.navigateTo({
					url:'./activeBefore_order?ptid='+this.ptid+'&shops='+JSON.stringify(goods_list)+'&leaderInfo='+(this.leaderInfo.address_id?JSON.stringify(this.leaderInfo):''),
					fail:(err)=>{
						console.log(err);
					}
				})
				return
				let coupon = '';
				if(this.coupon.length){
					this.coupon.map((item,index)=>{
						coupon = index == this.coupon.length-1?coupon + item.id:coupon + item.id+',';
					})
				}
				uni.showActionSheet({
					itemList:['微信支付','余额支付'],
					success: (op) => {
						let paytype = op.tapIndex == 0?'wxpay':'balance';
						if(paytype == 'balance' && this.wallet < this.price){
							uni.showModal({
								title:'余额不足 是否充值',
								success:(op)=>{
									if(op.confirm){
										uni.navigateTo({
											url:'./recharge'
										})
									}
								},
							})
							return;
						}
						this.tool.getData('/api/mall/createOrderByPintuan',{
							pt_id:this.ptid?this.ptid:'',
							tjr_mobile:this.mobile?this.mobile:'',
							address_id:this.leaderInfo.address_id,
							goods_list:JSON.stringify(goods_list),
							// goods_list:goods_list,
							service_user_id:this.leaderInfo.id,
							coupon:coupon,
							paytype:paytype,
						}).then(res=>{
							if(res){
								this.tool.getData('/api/mall/orderPay',{
									oid:res.id
								}).then(payInfo=>{
									if(paytype == 'wxpay'){
										uni.requestPayment({
											provider:'wxpay',
											timeStamp:payInfo.info.timeStamp,
											nonceStr:payInfo.info.nonceStr,
											package:payInfo.info.package,
											signType:payInfo.info.signType,
											paySign:payInfo.info.paySign,
											success: (pay) => {
												/* uni.showToast({
													title:'订单支付成功',
													icon:"success"
												}) */
												// 跳支付成功
												uni.redirectTo({
													url:'../seller/payResult?oid='+res.id+"&price="+this.price,
												})
												/* setTimeout(()=>{
													uni.switchTab({
														url:"/pages/seller"
													})
												},1650) */
											},
											fail:(err)=>{
												console.log(err);
												uni.showToast({
													title:'取消支付',
													icon:"none"
												})
												/* setTimeout(()=>{
													uni.switchTab({
														url:"/pages/seller"
													})
												},1650) */
											}
										})
									}else{
										/* uni.showToast({
											title:'订单支付成功',
											icon:"success"
										}) */
										uni.redirectTo({
											url:'../seller/payResult?oid='+res.id+"&price="+this.price,
										})
										/* setTimeout(()=>{
											uni.switchTab({
												url:"/pages/seller"
											})
										},1650) */
									}
								}).catch(err=>{
									console.log(err);
								})
							}
						}).catch(err=>{
							console.log(err);
						})
					},
					fail:(err)=>{
						console.log(err);
					}
				})
			},
			// 回到首页
			backHome(){
				if(this.pageIdx == '1'){
					uni.switchTab({
						url:"/pages/seller"
					})
				}else if(this.pageIdx == '3' || !this.pageIdx){
					uni.navigateBack({
						delta:1,
						fail:()=>{
							uni.switchTab({
								url:"/pages/seller"
							})
						}
					})
				}
			},
			// 计算剩余时间
			calcTime(time){
				return (time * 1000 - new Date().getTime()) / 1000;
			},
			// 修改数量
			changeCount(e,idx){
				if(this.datas.goods_list[idx].count>this.datas.goods_list[idx].goods_stock){
					uni.showToast({
						title:'库存数不足',
						icon:'none'
					})
					return;
				}
				let PT = uni.getStorageSync('PT')?JSON.parse(uni.getStorageSync('PT')):{};
				if(PT.id && PT.id == this.ptid){
					let index = this.tool.getIdx(PT.goods_list,'goods_id',this.datas.goods_list[idx].goods_id);
					if(index!='-1'){
						PT.goods_list[index].num = this.datas.goods_list[idx].count;
						uni.setStorageSync('PT',JSON.stringify(PT));
					}
				}
				this.calcOrderNum();
			},
			// 计算商品数量和显示价格
			calcOrderNum(){
				this.count0 = 0;
				this.price = 0;
				this.num = 0;
				this.datas.goods_list.map((item,index)=>{
					this.count0 = this.count0 + parseInt(item.count);
					this.num = this.num + parseInt(item.count);
					this.price = this.price + item.count * (item.goods_pt_price?item.goods_pt_price:item.goods_price);
				})
			},
			// 一键登录
			getPhoneNumber(e) {
				if (e.detail.errMsg == "getPhoneNumber:fail user deny") { //用户决绝授权  
					uni.showToast({
						title:'用户拒绝授权',
						icon:"none"
					})
				} else {
					this.tool.getData('/api/weixin/jscode2session',{
						code:this.code
					}).then(res=>{
						if(res){
							this.tool.getData('/api/weixin/programLogin',{
								encrypt: e.detail.encryptedData,
								iv: e.detail.iv,
								session_key: JSON.parse(res).session_key,
								openid: JSON.parse(res).openid,
								source:'0',
								tjr_mobile:uni.getStorageSync('tjr_mobile')?uni.getStorageSync('tjr_mobile'):'',
							}).then(res=>{
								if(res){
									uni.showToast({
										title:'登录成功',
										icon:"none"
									})
									this.storeOne = {};
									this.isLogin = true;
									uni.setStorageSync('uToken',res.userinfo.token);
									uni.setStorageSync('uId',res.userinfo.id);
									uni.setStorageSync('user_level',res.userinfo.user_level);
									getApp().globalData.isLogin = true;
									this.isLogin = true;
									this.initData();
									this.initwallet()
								}
							}).catch(err=>{
								console.log(err);
							})
						}
					}).catch(err=>{
						console.log(err);
					})
				}
			},
			// 保存图片
			saveImg(){
				this.createImg();
			},
			// 分享二维码
			initCode(){
				this.tool.getData('/api/pintuan/getPintuanQrcodeNew',{
					pt_id:this.ptid,
					tjr_mobile:this.datas.leaderInfo.mobile,
				}).then(res=>{
					if(res){
						this.postImg = res.qrcode;
						this.shareCode = res.cover_img;
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 生成图片
			createImg(){
				uni.showLoading({
					title:'制作中...'
				})
				let thumb = this.datas.share_img;
				let canvasWidth = uni.getSystemInfoSync().windowWidth * 0.8; 
				let ctx = uni.createCanvasContext('myCanvas', this);
				uni.getImageInfo({
					src:this.datas.share_img,
					success: (post) => {
						let rate = post.width / post.height;
						this.canvasHeight = canvasWidth / rate;
						setTimeout(()=>{
							// 填充背景色，白色
							ctx.setFillStyle('#FB5D02'); // 默认白色
							ctx.fillRect(0, 0,canvasWidth,this.canvasHeight); // fillRect(x,y,宽度，高度)
							ctx.drawImage(post.path,0,0,canvasWidth,this.canvasHeight);
							// 头像昵称
							uni.downloadFile({
								url:this.datas.leaderInfo.avatar,
								success: (tx) => {
									let txFile = tx.tempFilePath;
									this.tool.circleImgOne(ctx,txFile,12,8,12);
									// 昵称
									let nickname = this.datas.leaderInfo.nickname;
									ctx.setFontSize(13) // 字号
									ctx.setFillStyle('#ffffff') // 字体颜色
									ctx.fillText(nickname,40,20);//绘制截取部分
									// 提示文字1
									let toast1 = '我觉得这些产品很棒，推荐给你！';
									ctx.setFontSize(12) // 字号
									ctx.setFillStyle('#ffffff') // 字体颜色
									ctx.fillText(toast1,40,35);//绘制截取部分
									uni.hideLoading();
									// 二维码
									uni.showLoading({
										title:'正在为您生成专属分享码...'
									})
									this.tool.base64Save(this.postImg).then(code=>{
										ctx.drawImage(code,50,this.canvasHeight-67,50,50);
										ctx.draw(true,()=>{
											setTimeout(()=>{
												uni.canvasToTempFilePath({ // 保存canvas为图片
													canvasId: 'myCanvas',
													quality: 1,
													width:canvasWidth,
													height:this.canvasHeight,
													destWidth:canvasWidth * 3,
													destHeight:this.canvasHeight * 3,
													complete: (res)=> {
														uni.hideLoading();
														if(res.tempFilePath){
															uni.saveImageToPhotosAlbum({
																filePath:res.tempFilePath,
																success: () => {
																	uni.showToast({
																		title:"图片已保存",
																		icon:'success'
																	})
																	this.tool.monitor(this.link);
																},
																fail:(err)=>{
																	console.log(err);
																	uni.showToast({
																		title:'图片保存失败',
																		icon:'none'
																	})
																}
															})
														}
													},
												},this) // 这里是新增的this，只有在微信小程序中需要加入，不然会报错
											},500)
										})
									}).catch(err=>{
										console.log(err);
									})
								},
								fail:(err)=>{
									console.log(err);
								},
								complete: () => {}
							})
						},500)
					},
					fail:(err)=>{
						uni.showToast({
							title:'图片信息获取失败',
							icon:"none"
						})
					},
					complete: () => {
						
					}
				})
			},
			// 选择自提点
			selZiti(){
				// console.log(this.leaderInfo);
				this.count = 1;
				uni.navigateTo({
					url:'./ziti?ptid='+this.ptid+'&leaderInfo='+JSON.stringify(this.leaderInfo),
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: white;
	}
	.activeDetail{
		width: 100%;
		.bottomBtn{
			width: 100%;
			background: white;
			position: fixed;
			bottom: 0;
			left:0;
			padding: 20rpx 24rpx;
			box-sizing: border-box;
			.opBtns{
				width:37%;
				.smallMenu{
					width: 30%;
					text-align: center;
					font-size:12px;
					position: relative;
					.count{
						width: 34rpx;
						height: 34rpx;
						border-radius: 50%;
						text-align: center;
						line-height: 34rpx;
						background: #FF5000;
						position: absolute;
						top: -17rpx;
						right: -17rpx;
						color: #FDD100;
						font-size: 12px;
					}
					.menuIcon{
						width: 40rpx;
						height: 40rpx;
						margin:0 auto 4rpx;
					}
				}
			}
			.tj{
				width: auto;
				.allCount{
					.line2{
						width:100%;
						text-align: right;
						font-size: 12px;
						text{
							color: #FC4424;
						}
					}
					.resultPrice{
						text{
							color: #FF6200;
							font-size: 20px;
							font-weight: bold;
						}
					}
				}
				.payBtn{
					width: max-content;
					padding: 22rpx 42rpx;
					color: white;
					border-radius: 50px;
					background: linear-gradient(180deg, #FC9700 0%, #FF5000 100%);
					margin-left: 20rpx;
				}
			}
		}
		.content{
			width: 100%;
			// padding: 32px 3.2% 0;
			.team_member{
				width: 100%;
				padding: 0 14px;
				box-sizing: border-box;
				border-radius: 8px;
				background: white;
				position: relative;
				.shareBtn{
					width: max-content;
					color: #FF4A4D;
					padding: 6px 10px;
					border: 1px solid #FF4A4D;
					background: rgba(255,72,76,0.1);
					border-radius: 40px 0px 0px 40px;
					position: absolute;
					right: 0;
					bottom: 8px;
					.shareIcon{
						width: 15px;
						margin-right: 4px;
					}
				}
				.memberList{
					width:100%;
					padding-bottom: 14px;
					.part{
						padding: 10px 0;
						border-bottom: 1px solid #F1F1F1;
						.partInfo{
							flex: 1;
							.info{
								flex: 1;
								.base{
									width: 100%;
									.time{
										font-size: 13px;
										color: #999999;
										margin-left: 6px;
									}
								}
								.shopDesc{
									color: #999999;
									margin-top: 2px;
								}
							}
							.userTx{
								width: 40px;
								height: 40px;
								margin-right: 12px;
								border-radius: 50%;
								image{
									width: 40px;
									height: 40px;
								}
							}
						}
						.idx{
							width: 32px;
							height: 32px;
							text-align: center;
							line-height: 32px;
							font-size: 13px;
							margin-right: 24px;
							border-radius: 50%;
							color: #FB5D02;
							background: linear-gradient(90deg, #FEE2A2 0%, #FDEACA 100%);
						}
					}
					.part:last-child{
						border: none;
					}
				}
				.tit{
					padding: 12px 0 8px;
					text-align: center;
					color: #FB5D02;
				}
			}
			.product{
				width: 100%;
				.shop{
					width: 100%;
					padding: 12px;
					box-sizing: border-box;
					background:white;
					border-radius: 8px;
					.shopInfo{
						width: calc(100% - 90px);
						.shopName{
							width: 100%;
							/* overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap; */
							font-size: 16px;
							font-weight: bold;
						}
						.config{
							width: 100%;
							.priceTag{
								width: 100%;
								font-size: 12px;
								margin-bottom: 6rpx;
								.miaosha{
									width: max-content;
									background: linear-gradient(180deg, #FF6200 0%, #FE3140 100%);
									color: white;
									border: 1px solid #FF6200;
								}
								.jiang{
									color: #FF6200;
									border: 1px solid #FF6200;
								}
								view{
									padding: 0 8px;
									line-height: 36rpx;
									border-radius: 8rpx;
									margin-right:4rpx;
								}
							}
							.tools{
								width: 100%;
								.showPrice{
									color: #FF6200;
									font-size: 12px;
									text{
										font-size: 20px;
										font-weight: bold;
									}
								}
							}
						}
						/* .prices{
							.oldPrice{
								font-size: 12px;
								color: #999999;
								margin-left: 10px;
								text-decoration: line-through;
							}
							.showPrice{
								font-size: 12px;
								color:#FB5D02;
								text{
									font-size: 16px;
								}
							}
							.count{
								width: max-content;
							}
						} */
						.team{
							width: 100%;
							color: #666666;
							margin-bottom: 12px;
							.userTx{
								margin-right: 10px;
								.smallTx{
									width: 24px;
									height: 24px;
									border-radius: 50%;
									image{
										width: 24px;
										height: 24px;
									}
								}
							}
						}
						.jianshu{
							width: 100%;
							margin: 8px 0 12px;
							font-size: 12px;
							.sheng{
								line-height: 16px;
								border: 1px solid #FB5D02;
								color: #FB5D02;
								border-radius: 4px;
								padding: 0 4px;
							}
							.sale{
								width: max-content;
								color: #999999;
								background: #F7F6FB;
								line-height: 16px;
								padding: 0 4px;
								border-radius: 3px;
								margin-right: 8px;
							}
						}
					}
					.shopImg{
						width: 264rpx;
						height: 264rpx;
						border-radius: 6px;
						overflow: hidden;
						margin-right: 10px;
						position:relative;
						image{
							width: 100%;
						}
					}
				}
			}
			.regiment{
				width: 100%;
				background: linear-gradient(90deg, #FC9700 0%, #FF5000 100%);
				border-radius: 0px 0px 40rpx 40rpx;
				padding: 0 0 40rpx 0;
				box-sizing: border-box;
				position: relative;
				margin-bottom: 12px;
				.teamInfo{
					width: 93.6%;
					margin: 0 auto;
					background: white;
					padding: 24rpx;
					border-radius: 20rpx;
					.base{
						width: 100%;
						margin-bottom: 6px;
						color: #666666;
						.info_content{
							flex: 1;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
						}
						.timeDetail{
							flex: none;
							width: max-content!important;
							color: white;
							background: linear-gradient(180deg, #FCB900 0%, #FF6319 100%);
							font-size: 12px;
							padding: 4rpx 10rpx;
							border-radius: 8rpx;
						}
						.baseLeft{
							width: 82%;
						}
						.exchange{
							width: auto;
							margin-left: 6px;
							font-size: 12px;
							.rightIcon{
								width: 20px;
								margin-left: 2px;
							}
						}
						.titles{
							font-weight: bold;
							margin-right: 6px;
							.addIcon{
								width: 16px;
								height: 16px;
								margin-right: 6px;
							}
						}
					}
					.base:last-child{
						margin: 0;
					}
					.userInfo{
						padding:0 0 8px;
						border-bottom: 1px solid #F5F6F7;
						margin-bottom: 12px;
						.tuanzhang{
							flex: 1;
							.tag{
								width: max-content;
								font-size: 12px;
								color: #FB5D02;
								line-height: 20px;
								padding: 0 8px;
								border-radius: 40px;
								background: linear-gradient(90deg, #FEE2A2 0%, #FDEACA 100%);
								font-weight: bold;
								margin-left: 8px;
							}
							.userTx{
								width: 40px;
								height: 40px;
								border-radius: 50%;
								margin-right: 12px;
								image{
									width: 40px;
									height: 40px;
								}
							}
						}
						.distance{
							width: auto;
							color: #666666;
							.distanceIcon{
								width: 16px;
								margin-right: 4px;
							}
						}
					}
				}
				.timeShow{
					width: 100%;
					padding-left: 24rpx;
					box-sizing: border-box;
					.time{
						width: 190rpx;
					}
					.endTime{
						flex: 1;
						height: 44px;
						font-size: 16px;
						color:white;
						border-radius: 8px;
						.timeIcon{
							width: 32px;
							height: 32px;
						}
					}
				}
			}
		}
		.ios_pageTitle,.and_pageTitle{
			background: linear-gradient(90deg, #FC9700 0%, #FF5000 100%);
			.pageTitle{
				.titLeft{
					width: 100%;
					color:white;
					.title{
						flex: 1;
						text-align: center;
					}
					.backIcon{
						width: 56rpx;
						height: 56rpx;
						margin-right: 12px;
					}
				}
			}
		}
		// 复制按钮
		.service{
			width:44px;
			height:44px;
			position: fixed;
			left: 12px;
			bottom:12.5%;
		}
	}
	.ios_sureBtn{
		padding-bottom:env(safe-area-inset-bottom)!important;
	}
	.zz{
		color: white;
		font-size:16px;
		.coupon{
			color: #333333;
			width: 100%;
			border-top-left-radius: 40rpx;
			border-top-right-radius: 40rpx;
			background: white;
			max-height: 80%;
			position: relative;
			overflow: auto;
			padding-bottom: 80px;
			box-sizing: border-box;
			font-size:14px;
			.btns{
				width: 100%;
				padding: 20rpx 0;
				border-top: 1px solid #D8D8D8;
				position: fixed;
				left: 0;
				bottom: 0;
				background: white;
				.btn{
					width: 74.4%;
					text-align: center;
					color: white;
					border-radius: 50px;
					background: linear-gradient(180deg, #FC9700 0%, #FF5000 100%);
					padding: 24rpx 0;
					font-size: 16px;
				}
			}
			.qList{
				width: 100%;
				padding: 0 24rpx;
				box-sizing: border-box;
				.cpOne{
					width: 100%;
					background: white;
					border-radius: 20rpx;
					box-sizing: border-box;
					overflow: hidden;
					margin-bottom: 20rpx;
					.cpMain{
						width: 100%;
						position: relative;
						.cpBgImg{
							width: 100%;
							position: relative;
							.statusIcon{
								width: 40rpx;
								height: 40rpx;
								border-radius: 50%;
								background: white;
								position: absolute;
								top: 10rpx;
								right: 10rpx;
								image{
									width: 100%;
								}
							}
						}
						.cpContent{
							width: 100%;
							height: 100%;
							position: absolute;
							top: 0;
							left: 0;
							.contentLeft{
								width: 69%;
								height: 100%;
								padding:12rpx 24rpx;
								box-sizing: border-box;
								.content{
									width: 100%;
									.cpDetail{
										flex: 1;
										min-width: calc(100% - 70px);
										.toast{
											color: #666666;
											font-size: 12px;
											margin-bottom: 4rpx;
										}
										.cpName{
											margin-bottom: 4rpx;
											width: 100%;
											overflow: hidden;
											text-overflow: ellipsis;
											white-space: nowrap;
											font-size: 15px;
											font-weight: bold;
										}
										.time{
											color: #666666;
											font-size: 12px;
											margin-bottom: 12rpx;
										}
										.expbtn{
											color: #999999;
											font-size: 12px;
											.exBtn{
												width: 24rpx;
												height: 24rpx;
												margin-left: 8rpx;
											}
										}
									}
									.shopImg{
										width: 128rpx;
										height: 128rpx;
										margin-right:12rpx;
										position: relative;
										image{
											width: 100%;
											height: 100%;
											border-radius: 20rpx;
										}
									}
								}
								.tag{
									font-size: 10px;
									padding: 2px 18rpx;
									color: #FD5605;
									background: #FFF0E8;
									margin-bottom: 8rpx;
									width: max-content;
								}
							}
							.contentRight{
								width: 31%;
								height: 100%;
								padding: 24rpx;
								box-sizing: border-box;
								color: white;
								.useBtn{
									width: max-content;
									padding: 10rpx 16rpx;
									border-radius: 50px;
									background: white; 
									color: #FF5000;
									font-size: 12px;
								}
								.condition{
									font-size: 12px;
									margin-bottom: 10rpx;
								}
								.cpCount{
									font-size: 16px;
									font-weight: bolder;
									text{
										font-size: 34px;
									}
								}
							}
						}
					}
					.explain{
						width: 100%;
						padding: 24rpx;
						box-sizing: border-box;
						color: #999999;
						font-size: 12px;
						background: white;
						line-height: 38rpx;
					}
				}
			}
			.tools{
				color: #999999;
				font-size: 12px;
				margin-bottom: 30rpx;
				padding: 0 24rpx;
				width: 100%;
				box-sizing: border-box;
			}
			.titles{
				width: 100%;
				padding: 40rpx 0;
				font-size: 20px;
				font-weight: bold;
				.line{
					width: 160rpx;
					height: 0;
					border: 1px solid #C1C1C1;
					margin: 0 20rpx;
				}
			}
		}
		.closeBtn{
			width: max-content;
			padding: 8px 50px;
			margin: 10px auto;
			font-size: 12px;
			border-radius: 30px;
			color: white;
			border: 1px solid white;
		}
		.advImg{
			margin-bottom: 10px!important;
		}
		.opBtns{
			width: 100%;
			position: absolute;
			bottom: 0;
			left: 0;
			background: white;
			padding:0 0 25px;
			box-sizing: border-box;
			.toast{
				width: 100%;
				text-align:center;
				padding:12px 0;
				color:#666666;
			}
			.close{
				width: 94%;
				margin:6px auto 0;
				text-align:center;
				color:#666666;
				font-size:12px;
			}
			.btns{
				width: 100%;
				.opBtnOne{
					width: max-content;
					text-align: center;
					font-size: 12px;
					color: #333333;
					.btnImg{
						width: 45px;
						height: 45px;
						margin-bottom: 8px;
					}
				}
			}
		}
	}
	.zz2{
		top: 0;
		// left:-100%;
		left:0;
		position: fixed;
	}
</style>
